Hệ thống quản lý bệnh viện bằng C# với mã nguồn

  • hospitalDataSet.Designer.cs
  • project /
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated
by a tool.
4 // Runtime Version:
4.0.30319.42000
5 //
6 // Changes to
this file may cause incorrect behavior and will be lost if
7 // the code
is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------

10
11 #pragma warning disable
1591
12
13 namespace
HospitalManagementSystemCSharp {
14     
15     
16     ///
<summary>
17     ///
Represents a strongly typed in-memory cache of data.
18     ///</summary>

19     
[global::System.Serializable()]
20     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
21     
[global::System.ComponentModel.ToolboxItem(true)]
22     
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
23     
[global::System.Xml.Serialization.XmlRootAttribute("hospitalDataSet")]
24     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
25     
public partial class hospitalDataSet : global::System.Data.DataSet {
26         
27         
private staffDataTable tablestaff;
28         
29         
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
30         
31         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
32         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
33         
public hospitalDataSet() {
34             
this.BeginInit();
35             
this.InitClass();
36             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
37             
base.Tables.CollectionChanged += schemaChangedHandler;
38             
base.Relations.CollectionChanged += schemaChangedHandler;
39             
this.EndInit();
40         }
41         
42         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
43         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
44         
protected hospitalDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
45                 
base(info, context, false) {
46             
if ((this.IsBinarySerialized(info, context) == true)) {
47                 
this.InitVars(false);
48                 
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
49                 
this.Tables.CollectionChanged += schemaChangedHandler1;
50                 
this.Relations.CollectionChanged += schemaChangedHandler1;
51                 
return;
52             }
53             
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
54             
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
55                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
56                 ds.ReadXmlSchema(
new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
57                 
if ((ds.Tables["staff"] != null)) {
58                     
base.Tables.Add(new staffDataTable(ds.Tables["staff"]));
59                 }
60                 
this.DataSetName = ds.DataSetName;
61                 
this.Prefix = ds.Prefix;
62                 
this.Namespace = ds.Namespace;
63                 
this.Locale = ds.Locale;
64                 
this.CaseSensitive = ds.CaseSensitive;
65                 
this.EnforceConstraints = ds.EnforceConstraints;
66                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
67                 
this.InitVars();
68             }
69             
else {
70                 
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
71             }
72             
this.GetSerializationData(info, context);
73             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
74             
base.Tables.CollectionChanged += schemaChangedHandler;
75             
this.Relations.CollectionChanged += schemaChangedHandler;
76         }
77         
78         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
79         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
80         
[global::System.ComponentModel.Browsable(false)]
81         
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
82         
public staffDataTable staff {
83             
get {
84                 
return this.tablestaff;
85             }
86         }
87         
88         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
89         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
90         
[global::System.ComponentModel.BrowsableAttribute(true)]
91         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
92         
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
93             
get {
94                 
return this._schemaSerializationMode;
95             }
96             
set {
97                 
this._schemaSerializationMode = value;
98             }
99         }
100         
101         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
102         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
103         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
104         
public new global::System.Data.DataTableCollection Tables {
105             
get {
106                 
return base.Tables;
107             }
108         }
109         
110         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
111         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
112         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
113         
public new global::System.Data.DataRelationCollection Relations {
114             
get {
115                 
return base.Relations;
116             }
117         }
118         
119         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
120         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
121         
protected override void InitializeDerivedDataSet() {
122             
this.BeginInit();
123             
this.InitClass();
124             
this.EndInit();
125         }
126         
127         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
128         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
129         
public override global::System.Data.DataSet Clone() {
130             hospitalDataSet cln = ((hospitalDataSet)(
base.Clone()));
131             cln.InitVars();
132             cln.SchemaSerializationMode =
this.SchemaSerializationMode;
133             
return cln;
134         }
135         
136         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
137         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
138         
protected override bool ShouldSerializeTables() {
139             
return false;
140         }
141         
142         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
143         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
144         
protected override bool ShouldSerializeRelations() {
145             
return false;
146         }
147         
148         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
149         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
150         
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
151             
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
152                 
this.Reset();
153                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
154                 ds.ReadXml(reader);
155                 
if ((ds.Tables["staff"] != null)) {
156                     
base.Tables.Add(new staffDataTable(ds.Tables["staff"]));
157                 }
158                 
this.DataSetName = ds.DataSetName;
159                 
this.Prefix = ds.Prefix;
160                 
this.Namespace = ds.Namespace;
161                 
this.Locale = ds.Locale;
162                 
this.CaseSensitive = ds.CaseSensitive;
163                 
this.EnforceConstraints = ds.EnforceConstraints;
164                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
165                 
this.InitVars();
166             }
167             
else {
168                 
this.ReadXml(reader);
169                 
this.InitVars();
170             }
171         }
172         
173         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
174         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
175         
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
176             
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
177             
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
178             stream.Position =
0;
179             
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
180         }
181         
182         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
183         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
184         
internal void InitVars() {
185             
this.InitVars(true);
186         }
187         
188         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
189         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
190         
internal void InitVars(bool initTable) {
191             
this.tablestaff = ((staffDataTable)(base.Tables["staff"]));
192             
if ((initTable == true)) {
193                 
if ((this.tablestaff != null)) {
194                     
this.tablestaff.InitVars();
195                 }
196             }
197         }
198         
199         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
200         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
201         
private void InitClass() {
202             
this.DataSetName = "hospitalDataSet";
203             
this.Prefix = "";
204             
this.Namespace = "http://tempuri.org/hospitalDataSet.xsd";
205             
this.EnforceConstraints = true;
206             
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
207             
this.tablestaff = new staffDataTable();
208             
base.Tables.Add(this.tablestaff);
209         }
210         
211         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
212         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
213         
private bool ShouldSerializestaff() {
214             
return false;
215         }
216         
217         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
218         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
219         
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
220             
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
221                 
this.InitVars();
222             }
223         }
224         
225         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
226         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
227         
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
228             hospitalDataSet ds =
new hospitalDataSet();
229             
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
230             
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
231             
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
232             any.Namespace = ds.Namespace;
233             sequence.Items.Add(any);
234             type.Particle = sequence;
235             
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
236             
if (xs.Contains(dsSchema.TargetNamespace)) {
237                 
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
238                 
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
239                 
try {
240                     
global::System.Xml.Schema.XmlSchema schema = null;
241                     dsSchema.Write(s1);
242                     
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
243                         schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
244                         s2.SetLength(
0);
245                         schema.Write(s2);
246                         
if ((s1.Length == s2.Length)) {
247                             s1.Position =
0;
248                             s2.Position =
0;
249                             
for (; ((s1.Position != s1.Length)
250                                         && (s1.ReadByte() == s2.ReadByte())); ) {
251                                 ;
252                             }
253                             
if ((s1.Position == s1.Length)) {
254                                 
return type;
255                             }
256                         }
257                     }
258                 }
259                 
finally {
260                     
if ((s1 != null)) {
261                         s1.Close();
262                     }
263                     
if ((s2 != null)) {
264                         s2.Close();
265                     }
266                 }
267             }
268             xs.Add(dsSchema);
269             
return type;
270         }
271         
272         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
273         
public delegate void staffRowChangeEventHandler(object sender, staffRowChangeEvent e);
274         
275         ///
<summary>
276         ///
Represents the strongly named DataTable class.
277         ///</summary>

278         
[global::System.Serializable()]
279         
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
280         
public partial class staffDataTable : global::System.Data.TypedTableBase<staffRow> {
281             
282             
private global::System.Data.DataColumn columnId;
283             
284             
private global::System.Data.DataColumn columnname;
285             
286             
private global::System.Data.DataColumn columngender;
287             
288             
private global::System.Data.DataColumn columnposition;
289             
290             
private global::System.Data.DataColumn columnsalary;
291             
292             
private global::System.Data.DataColumn columncontact;
293             
294             
private global::System.Data.DataColumn columnaddress;
295             
296             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
297             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
298             
public staffDataTable() {
299                 
this.TableName = "staff";
300                 
this.BeginInit();
301                 
this.InitClass();
302                 
this.EndInit();
303             }
304             
305             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
306             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
307             
internal staffDataTable(global::System.Data.DataTable table) {
308                 
this.TableName = table.TableName;
309                 
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
310                     
this.CaseSensitive = table.CaseSensitive;
311                 }
312                 
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
313                     
this.Locale = table.Locale;
314                 }
315                 
if ((table.Namespace != table.DataSet.Namespace)) {
316                     
this.Namespace = table.Namespace;
317                 }
318                 
this.Prefix = table.Prefix;
319                 
this.MinimumCapacity = table.MinimumCapacity;
320             }
321             
322             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
323             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
324             
protected staffDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
325                     
base(info, context) {
326                 
this.InitVars();
327             }
328             
329             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
330             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
331             
public global::System.Data.DataColumn IdColumn {
332                 
get {
333                     
return this.columnId;
334                 }
335             }
336             
337             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
338             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
339             
public global::System.Data.DataColumn nameColumn {
340                 
get {
341                     
return this.columnname;
342                 }
343             }
344             
345             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
346             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
347             
public global::System.Data.DataColumn genderColumn {
348                 
get {
349                     
return this.columngender;
350                 }
351             }
352             
353             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
354             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
355             
public global::System.Data.DataColumn positionColumn {
356                 
get {
357                     
return this.columnposition;
358                 }
359             }
360             
361             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
362             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
363             
public global::System.Data.DataColumn salaryColumn {
364                 
get {
365                     
return this.columnsalary;
366                 }
367             }
368             
369             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
370             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
371             
public global::System.Data.DataColumn contactColumn {
372                 
get {
373                     
return this.columncontact;
374                 }
375             }
376             
377             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
378             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
379             
public global::System.Data.DataColumn addressColumn {
380                 
get {
381                     
return this.columnaddress;
382                 }
383             }
384             
385             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
386             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
387             
[global::System.ComponentModel.Browsable(false)]
388             
public int Count {
389                 
get {
390                     
return this.Rows.Count;
391                 }
392             }
393             
394             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
395             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
396             
public staffRow this[int index] {
397                 
get {
398                     
return ((staffRow)(this.Rows[index]));
399                 }
400             }
401             
402             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
403             
public event staffRowChangeEventHandler staffRowChanging;
404             
405             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
406             
public event staffRowChangeEventHandler staffRowChanged;
407             
408             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
409             
public event staffRowChangeEventHandler staffRowDeleting;
410             
411             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
412             
public event staffRowChangeEventHandler staffRowDeleted;
413             
414             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
415             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
416             
public void AddstaffRow(staffRow row) {
417                 
this.Rows.Add(row);
418             }
419             
420             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
421             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
422             
public staffRow AddstaffRow(string name, string gender, string position, string salary, string contact, string address) {
423                 staffRow rowstaffRow = ((staffRow)(
this.NewRow()));
424                 
object[] columnValuesArray = new object[] {
425                         
null,
426                         name,
427                         gender,
428                         position,
429                         salary,
430                         contact,
431                         address};
432                 rowstaffRow.ItemArray = columnValuesArray;
433                 
this.Rows.Add(rowstaffRow);
434                 
return rowstaffRow;
435             }
436             
437             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
438             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
439             
public staffRow FindById(int Id) {
440                 
return ((staffRow)(this.Rows.Find(new object[] {
441                             Id})));
442             }
443             
444             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
445             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
446             
public override global::System.Data.DataTable Clone() {
447                 staffDataTable cln = ((staffDataTable)(
base.Clone()));
448                 cln.InitVars();
449                 
return cln;
450             }
451             
452             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
453             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
454             
protected override global::System.Data.DataTable CreateInstance() {
455                 
return new staffDataTable();
456             }
457             
458             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
459             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
460             
internal void InitVars() {
461                 
this.columnId = base.Columns["Id"];
462                 
this.columnname = base.Columns["name"];
463                 
this.columngender = base.Columns["gender"];
464                 
this.columnposition = base.Columns["position"];
465                 
this.columnsalary = base.Columns["salary"];
466                 
this.columncontact = base.Columns["contact"];
467                 
this.columnaddress = base.Columns["address"];
468             }
469             
470             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
471             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
472             
private void InitClass() {
473                 
this.columnId = new global::System.Data.DataColumn("Id", typeof(int), null, global::System.Data.MappingType.Element);
474                 
base.Columns.Add(this.columnId);
475                 
this.columnname = new global::System.Data.DataColumn("name", typeof(string), null, global::System.Data.MappingType.Element);
476                 
base.Columns.Add(this.columnname);
477                 
this.columngender = new global::System.Data.DataColumn("gender", typeof(string), null, global::System.Data.MappingType.Element);
478                 
base.Columns.Add(this.columngender);
479                 
this.columnposition = new global::System.Data.DataColumn("position", typeof(string), null, global::System.Data.MappingType.Element);
480                 
base.Columns.Add(this.columnposition);
481                 
this.columnsalary = new global::System.Data.DataColumn("salary", typeof(string), null, global::System.Data.MappingType.Element);
482                 
base.Columns.Add(this.columnsalary);
483                 
this.columncontact = new global::System.Data.DataColumn("contact", typeof(string), null, global::System.Data.MappingType.Element);
484                 
base.Columns.Add(this.columncontact);
485                 
this.columnaddress = new global::System.Data.DataColumn("address", typeof(string), null, global::System.Data.MappingType.Element);
486                 
base.Columns.Add(this.columnaddress);
487                 
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
488                                 
this.columnId}, true));
489                 
this.columnId.AutoIncrement = true;
490                 
this.columnId.AutoIncrementSeed = -1;
491                 
this.columnId.AutoIncrementStep = -1;
492                 
this.columnId.AllowDBNull = false;
493                 
this.columnId.ReadOnly = true;
494                 
this.columnId.Unique = true;
495                 
this.columnname.MaxLength = 50;
496                 
this.columngender.MaxLength = 50;
497                 
this.columnposition.MaxLength = 50;
498                 
this.columnsalary.MaxLength = 50;
499                 
this.columncontact.MaxLength = 50;
500                 
this.columnaddress.MaxLength = 50;
501             }
502             
503             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
504             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
505             
public staffRow NewstaffRow() {
506                 
return ((staffRow)(this.NewRow()));
507             }
508             
509             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
510             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
511             
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
512                 
return new staffRow(builder);
513             }
514             
515             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
516             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
517             
protected override global::System.Type GetRowType() {
518                 
return typeof(staffRow);
519             }
520             
521             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
522             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
523             
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
524                 
base.OnRowChanged(e);
525                 
if ((this.staffRowChanged != null)) {
526                     
this.staffRowChanged(this, new staffRowChangeEvent(((staffRow)(e.Row)), e.Action));
527                 }
528             }
529             
530             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
531             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
532             
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
533                 
base.OnRowChanging(e);
534                 
if ((this.staffRowChanging != null)) {
535                     
this.staffRowChanging(this, new staffRowChangeEvent(((staffRow)(e.Row)), e.Action));
536                 }
537             }
538             
539             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
540             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
541             
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
542                 
base.OnRowDeleted(e);
543                 
if ((this.staffRowDeleted != null)) {
544                     
this.staffRowDeleted(this, new staffRowChangeEvent(((staffRow)(e.Row)), e.Action));
545                 }
546             }
547             
548             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
549             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
550             
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
551                 
base.OnRowDeleting(e);
552                 
if ((this.staffRowDeleting != null)) {
553                     
this.staffRowDeleting(this, new staffRowChangeEvent(((staffRow)(e.Row)), e.Action));
554                 }
555             }
556             
557             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
558             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
559             
public void RemovestaffRow(staffRow row) {
560                 
this.Rows.Remove(row);
561             }
562             
563             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
564             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
565             
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
566                 
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
567                 
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
568                 hospitalDataSet ds =
new hospitalDataSet();
569                 
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
570                 any1.Namespace =
"http://www.w3.org/2001/XMLSchema";
571                 any1.MinOccurs =
new decimal(0);
572                 any1.MaxOccurs =
decimal.MaxValue;
573                 any1.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
574                 sequence.Items.Add(any1);
575                 
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
576                 any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1";
577                 any2.MinOccurs =
new decimal(1);
578                 any2.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
579                 sequence.Items.Add(any2);
580                 
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
581                 attribute1.Name =
"namespace";
582                 attribute1.FixedValue = ds.Namespace;
583                 type.Attributes.Add(attribute1);
584                 
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
585                 attribute2.Name =
"tableTypeName";
586                 attribute2.FixedValue =
"staffDataTable";
587                 type.Attributes.Add(attribute2);
588                 type.Particle = sequence;
589                 
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
590                 
if (xs.Contains(dsSchema.TargetNamespace)) {
591                     
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
592                     
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
593                     
try {
594                         
global::System.Xml.Schema.XmlSchema schema = null;
595                         dsSchema.Write(s1);
596                         
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
597                             schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
598                             s2.SetLength(
0);
599                             schema.Write(s2);
600                             
if ((s1.Length == s2.Length)) {
601                                 s1.Position =
0;
602                                 s2.Position =
0;
603                                 
for (; ((s1.Position != s1.Length)
604                                             && (s1.ReadByte() == s2.ReadByte())); ) {
605                                     ;
606                                 }
607                                 
if ((s1.Position == s1.Length)) {
608                                     
return type;
609                                 }
610                             }
611                         }
612                     }
613                     
finally {
614                         
if ((s1 != null)) {
615                             s1.Close();
616                         }
617                         
if ((s2 != null)) {
618                             s2.Close();
619                         }
620                     }
621                 }
622                 xs.Add(dsSchema);
623                 
return type;
624             }
625         }

626         
627         ///
<summary>
628         ///
Represents strongly named DataRow class.
629         ///</summary>

630         
public partial class staffRow : global::System.Data.DataRow {
631             
632             
private staffDataTable tablestaff;
633             
634             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
635             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
636             
internal staffRow(global::System.Data.DataRowBuilder rb) :
637                     
base(rb) {
638                 
this.tablestaff = ((staffDataTable)(this.Table));
639             }
640             
641             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
642             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
643             
public int Id {
644                 
get {
645                     
return ((int)(this[this.tablestaff.IdColumn]));
646                 }
647                 
set {
648                     
this[this.tablestaff.IdColumn] = value;
649                 }
650             }
651             
652             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
653             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
654             
public string name {
655                 
get {
656                     
try {
657                         
return ((string)(this[this.tablestaff.nameColumn]));
658                     }
659                     
catch (global::System.InvalidCastException e) {
660                         
throw new global::System.Data.StrongTypingException("The value for column \'name\' in table \'staff\' is DBNull.", e);
661                     }
662                 }
663                 
set {
664                     
this[this.tablestaff.nameColumn] = value;
665                 }
666             }
667             
668             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
669             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
670             
public string gender {
671                 
get {
672                     
try {
673                         
return ((string)(this[this.tablestaff.genderColumn]));
674                     }
675                     
catch (global::System.InvalidCastException e) {
676                         
throw new global::System.Data.StrongTypingException("The value for column \'gender\' in table \'staff\' is DBNull.", e);
677                     }
678                 }
679                 
set {
680                     
this[this.tablestaff.genderColumn] = value;
681                 }
682             }
683             
684             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
685             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
686             
public string position {
687                 
get {
688                     
try {
689                         
return ((string)(this[this.tablestaff.positionColumn]));
690                     }
691                     
catch (global::System.InvalidCastException e) {
692                         
throw new global::System.Data.StrongTypingException("The value for column \'position\' in table \'staff\' is DBNull.", e);
693                     }
694                 }
695                 
set {
696                     
this[this.tablestaff.positionColumn] = value;
697                 }
698             }
699             
700             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
701             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
702             
public string salary {
703                 
get {
704                     
try {
705                         
return ((string)(this[this.tablestaff.salaryColumn]));
706                     }
707                     
catch (global::System.InvalidCastException e) {
708                         
throw new global::System.Data.StrongTypingException("The value for column \'salary\' in table \'staff\' is DBNull.", e);
709                     }
710                 }
711                 
set {
712                     
this[this.tablestaff.salaryColumn] = value;
713                 }
714             }
715             
716             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
717             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
718             
public string contact {
719                 
get {
720                     
try {
721                         
return ((string)(this[this.tablestaff.contactColumn]));
722                     }
723                     
catch (global::System.InvalidCastException e) {
724                         
throw new global::System.Data.StrongTypingException("The value for column \'contact\' in table \'staff\' is DBNull.", e);
725                     }
726                 }
727                 
set {
728                     
this[this.tablestaff.contactColumn] = value;
729                 }
730             }
731             
732             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
733             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
734             
public string address {
735                 
get {
736                     
try {
737                         
return ((string)(this[this.tablestaff.addressColumn]));
738                     }
739                     
catch (global::System.InvalidCastException e) {
740                         
throw new global::System.Data.StrongTypingException("The value for column \'address\' in table \'staff\' is DBNull.", e);
741                     }
742                 }
743                 
set {
744                     
this[this.tablestaff.addressColumn] = value;
745                 }
746             }
747             
748             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
749             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
750             
public bool IsnameNull() {
751                 
return this.IsNull(this.tablestaff.nameColumn);
752             }
753             
754             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
755             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
756             
public void SetnameNull() {
757                 
this[this.tablestaff.nameColumn] = global::System.Convert.DBNull;
758             }
759             
760             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
761             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
762             
public bool IsgenderNull() {
763                 
return this.IsNull(this.tablestaff.genderColumn);
764             }
765             
766             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
767             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
768             
public void SetgenderNull() {
769                 
this[this.tablestaff.genderColumn] = global::System.Convert.DBNull;
770             }
771             
772             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
773             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
774             
public bool IspositionNull() {
775                 
return this.IsNull(this.tablestaff.positionColumn);
776             }
777             
778             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
779             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
780             
public void SetpositionNull() {
781                 
this[this.tablestaff.positionColumn] = global::System.Convert.DBNull;
782             }
783             
784             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
785             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
786             
public bool IssalaryNull() {
787                 
return this.IsNull(this.tablestaff.salaryColumn);
788             }
789             
790             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
791             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
792             
public void SetsalaryNull() {
793                 
this[this.tablestaff.salaryColumn] = global::System.Convert.DBNull;
794             }
795             
796             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
797             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
798             
public bool IscontactNull() {
799                 
return this.IsNull(this.tablestaff.contactColumn);
800             }
801             
802             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
803             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
804             
public void SetcontactNull() {
805                 
this[this.tablestaff.contactColumn] = global::System.Convert.DBNull;
806             }
807             
808             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
809             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
810             
public bool IsaddressNull() {
811                 
return this.IsNull(this.tablestaff.addressColumn);
812             }
813             
814             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
815             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
816             
public void SetaddressNull() {
817                 
this[this.tablestaff.addressColumn] = global::System.Convert.DBNull;
818             }
819         }

820         
821         ///
<summary>
822         ///
Row event argument class
823         ///</summary>

824         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
825         
public class staffRowChangeEvent : global::System.EventArgs {
826             
827             
private staffRow eventRow;
828             
829             
private global::System.Data.DataRowAction eventAction;
830             
831             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
832             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
833             
public staffRowChangeEvent(staffRow row, global::System.Data.DataRowAction action) {
834                 
this.eventRow = row;
835                 
this.eventAction = action;
836             }
837             
838             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
839             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
840             
public staffRow Row {
841                 
get {
842                     
return this.eventRow;
843                 }
844             }
845             
846             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
847             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
848             
public global::System.Data.DataRowAction Action {
849                 
get {
850                     
return this.eventAction;
851                 }
852             }
853         }
854     }
855 }

856 namespace
HospitalManagementSystemCSharp.hospitalDataSetTableAdapters {
857     
858     
859     ///
<summary>
860     ///
Represents the connection and commands used to retrieve and save data.
861     ///</summary>

862     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
863     
[global::System.ComponentModel.ToolboxItem(true)]
864     
[global::System.ComponentModel.DataObjectAttribute(true)]
865     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
866         
", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
867     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
868     
public partial class staffTableAdapter : global::System.ComponentModel.Component {
869         
870         
private global::System.Data.SqlClient.SqlDataAdapter _adapter;
871         
872         
private global::System.Data.SqlClient.SqlConnection _connection;
873         
874         
private global::System.Data.SqlClient.SqlTransaction _transaction;
875         
876         
private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
877         
878         
private bool _clearBeforeFill;
879         
880         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
881         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
882         
public staffTableAdapter() {
883             
this.ClearBeforeFill = true;
884         }
885         
886         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
887         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
888         
protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
889             
get {
890                 
if ((this._adapter == null)) {
891                     
this.InitAdapter();
892                 }
893                 
return this._adapter;
894             }
895         }
896         
897         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
898         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
899         
internal global::System.Data.SqlClient.SqlConnection Connection {
900             
get {
901                 
if ((this._connection == null)) {
902                     
this.InitConnection();
903                 }
904                 
return this._connection;
905             }
906             
set {
907                 
this._connection = value;
908                 
if ((this.Adapter.InsertCommand != null)) {
909                     
this.Adapter.InsertCommand.Connection = value;
910                 }
911                 
if ((this.Adapter.DeleteCommand != null)) {
912                     
this.Adapter.DeleteCommand.Connection = value;
913                 }
914                 
if ((this.Adapter.UpdateCommand != null)) {
915                     
this.Adapter.UpdateCommand.Connection = value;
916                 }
917                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
918                     
if ((this.CommandCollection[i] != null)) {
919                         ((
global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
920                     }
921                 }
922             }
923         }
924         
925         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
926         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
927         
internal global::System.Data.SqlClient.SqlTransaction Transaction {
928             
get {
929                 
return this._transaction;
930             }
931             
set {
932                 
this._transaction = value;
933                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
934                     
this.CommandCollection[i].Transaction = this._transaction;
935                 }
936                 
if (((this.Adapter != null)
937                             && (
this.Adapter.DeleteCommand != null))) {
938                     
this.Adapter.DeleteCommand.Transaction = this._transaction;
939                 }
940                 
if (((this.Adapter != null)
941                             && (
this.Adapter.InsertCommand != null))) {
942                     
this.Adapter.InsertCommand.Transaction = this._transaction;
943                 }
944                 
if (((this.Adapter != null)
945                             && (
this.Adapter.UpdateCommand != null))) {
946                     
this.Adapter.UpdateCommand.Transaction = this._transaction;
947                 }
948             }
949         }
950         
951         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
952         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
953         
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
954             
get {
955                 
if ((this._commandCollection == null)) {
956                     
this.InitCommandCollection();
957                 }
958                 
return this._commandCollection;
959             }
960         }
961         
962         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
963         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
964         
public bool ClearBeforeFill {
965             
get {
966                 
return this._clearBeforeFill;
967             }
968             
set {
969                 
this._clearBeforeFill = value;
970             }
971         }
972         
973         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
974         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
975         
private void InitAdapter() {
976             
this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
977             
global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
978             tableMapping.SourceTable =
"Table";
979             tableMapping.DataSetTable =
"staff";
980             tableMapping.ColumnMappings.Add(
"Id", "Id");
981             tableMapping.ColumnMappings.Add(
"name", "name");
982             tableMapping.ColumnMappings.Add(
"gender", "gender");
983             tableMapping.ColumnMappings.Add(
"position", "position");
984             tableMapping.ColumnMappings.Add(
"salary", "salary");
985             tableMapping.ColumnMappings.Add(
"contact", "contact");
986             tableMapping.ColumnMappings.Add(
"address", "address");
987             
this._adapter.TableMappings.Add(tableMapping);
988             
this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
989             
this._adapter.DeleteCommand.Connection = this.Connection;
990             
this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[staff] WHERE (([Id] = @Original_Id) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_gender = 1 AND [gender] IS NULL) OR ([gender] = @Original_gender)) AND ((@IsNull_position = 1 AND [position] IS NULL) OR ([position] = @Original_position)) AND ((@IsNull_salary = 1 AND [salary] IS NULL) OR ([salary] = @Original_salary)) AND ((@IsNull_contact = 1 AND [contact] IS NULL) OR ([contact] = @Original_contact)) AND ((@IsNull_address = 1 AND [address] IS NULL) OR ([address] = @Original_address)))";
991             
this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
992             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
993             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_name", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
994             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_name", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
995             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_gender", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
996             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_gender", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
997             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_position", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
998             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_position", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
999             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_salary", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1000             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_salary", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1001             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_contact", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1002             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_contact", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1003             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_address", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1004             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_address", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1005             
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
1006             
this._adapter.InsertCommand.Connection = this.Connection;
1007             
this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[staff] ([name], [gender], [position], [salary], [contact], [ad" +
1008                 
"dress]) VALUES (@name, @gender, @position, @salary, @contact, @address);\r\nSELECT" +
1009                 
" Id, name, gender, position, salary, contact, address FROM staff WHERE (Id = SCO" +
1010                 
"PE_IDENTITY())";
1011             
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
1012             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@name", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1013             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gender", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1014             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@position", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1015             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@salary", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1016             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@contact", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1017             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@address", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1018             
this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
1019             
this._adapter.UpdateCommand.Connection = this.Connection;
1020             
this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[staff] SET [name] = @name, [gender] = @gender, [position] = @position, [salary] = @salary, [contact] = @contact, [address] = @address WHERE (([Id] = @Original_Id) AND ((@IsNull_name = 1 AND [name] IS NULL) OR ([name] = @Original_name)) AND ((@IsNull_gender = 1 AND [gender] IS NULL) OR ([gender] = @Original_gender)) AND ((@IsNull_position = 1 AND [position] IS NULL) OR ([position] = @Original_position)) AND ((@IsNull_salary = 1 AND [salary] IS NULL) OR ([salary] = @Original_salary)) AND ((@IsNull_contact = 1 AND [contact] IS NULL) OR ([contact] = @Original_contact)) AND ((@IsNull_address = 1 AND [address] IS NULL) OR ([address] = @Original_address)));
1021 SELECT Id, name, gender, position, salary, contact, address FROM staff WHERE (Id = @Id)"
;
1022             
this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
1023             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@name", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1024             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gender", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1025             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@position", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1026             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@salary", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1027             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@contact", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1028             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@address", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1029             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1030             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_name", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1031             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_name", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1032             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_gender", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1033             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_gender", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "gender", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1034             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_position", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1035             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_position", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "position", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1036             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_salary", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1037             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_salary", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "salary", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1038             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_contact", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1039             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_contact", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "contact", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1040             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_address", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
1041             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_address", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "address", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
1042             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
1043         }
1044         
1045         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1046         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1047         
private void InitConnection() {
1048             
this._connection = new global::System.Data.SqlClient.SqlConnection();
1049             
this._connection.ConnectionString = global::HospitalManagementSystemCSharp.Properties.Settings.Default.hospitalConnectionString;
1050         }
1051         
1052         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1053         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1054         
private void InitCommandCollection() {
1055             
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
1056             
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
1057             
this._commandCollection[0].Connection = this.Connection;
1058             
this._commandCollection[0].CommandText = "SELECT Id, name, gender, position, salary, contact, address FROM dbo.staff";
1059             
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
1060         }
1061         
1062         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1063         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1064         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1065         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
1066         
public virtual int Fill(hospitalDataSet.staffDataTable dataTable) {
1067             
this.Adapter.SelectCommand = this.CommandCollection[0];
1068             
if ((this.ClearBeforeFill == true)) {
1069                 dataTable.Clear();
1070             }
1071             
int returnValue = this.Adapter.Fill(dataTable);
1072             
return returnValue;
1073         }
1074         
1075         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1076         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1077         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1078         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
1079         
public virtual hospitalDataSet.staffDataTable GetData() {
1080             
this.Adapter.SelectCommand = this.CommandCollection[0];
1081             hospitalDataSet.staffDataTable dataTable =
new hospitalDataSet.staffDataTable();
1082             
this.Adapter.Fill(dataTable);
1083             
return dataTable;
1084         }
1085         
1086         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1087         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1088         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1089         
public virtual int Update(hospitalDataSet.staffDataTable dataTable) {
1090             
return this.Adapter.Update(dataTable);
1091         }
1092         
1093         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1094         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1095         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1096         
public virtual int Update(hospitalDataSet dataSet) {
1097             
return this.Adapter.Update(dataSet, "staff");
1098         }
1099         
1100         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1101         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1102         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1103         
public virtual int Update(global::System.Data.DataRow dataRow) {
1104             
return this.Adapter.Update(new global::System.Data.DataRow[] {
1105                         dataRow});
1106         }
1107         
1108         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1109         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1110         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1111         
public virtual int Update(global::System.Data.DataRow[] dataRows) {
1112             
return this.Adapter.Update(dataRows);
1113         }
1114         
1115         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1116         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1117         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1118         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
1119         
public virtual int Delete(int Original_Id, string Original_name, string Original_gender, string Original_position, string Original_salary, string Original_contact, string Original_address) {
1120             
this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_Id));
1121             
if ((Original_name == null)) {
1122                 
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
1123                 
this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
1124             }
1125             
else {
1126                 
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
1127                 
this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_name));
1128             }
1129             
if ((Original_gender == null)) {
1130                 
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
1131                 
this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
1132             }
1133             
else {
1134                 
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
1135                 
this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_gender));
1136             }
1137             
if ((Original_position == null)) {
1138                 
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
1139                 
this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
1140             }
1141             
else {
1142                 
this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
1143                 
this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_position));
1144             }
1145             
if ((Original_salary == null)) {
1146                 
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
1147                 
this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
1148             }
1149             
else {
1150                 
this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
1151                 
this.Adapter.DeleteCommand.Parameters[8].Value = ((string)(Original_salary));
1152             }
1153             
if ((Original_contact == null)) {
1154                 
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
1155                 
this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
1156             }
1157             
else {
1158                 
this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
1159                 
this.Adapter.DeleteCommand.Parameters[10].Value = ((string)(Original_contact));
1160             }
1161             
if ((Original_address == null)) {
1162                 
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
1163                 
this.Adapter.DeleteCommand.Parameters[12].Value = global::System.DBNull.Value;
1164             }
1165             
else {
1166                 
this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
1167                 
this.Adapter.DeleteCommand.Parameters[12].Value = ((string)(Original_address));
1168             }
1169             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
1170             
if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
1171                         !=
global::System.Data.ConnectionState.Open)) {
1172                 
this.Adapter.DeleteCommand.Connection.Open();
1173             }
1174             
try {
1175                 
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
1176                 
return returnValue;
1177             }
1178             
finally {
1179                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1180                     
this.Adapter.DeleteCommand.Connection.Close();
1181                 }
1182             }
1183         }
1184         
1185         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1186         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1187         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1188         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
1189         
public virtual int Insert(string name, string gender, string position, string salary, string contact, string address) {
1190             
if ((name == null)) {
1191                 
this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
1192             }
1193             
else {
1194                 
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(name));
1195             }
1196             
if ((gender == null)) {
1197                 
this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
1198             }
1199             
else {
1200                 
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(gender));
1201             }
1202             
if ((position == null)) {
1203                 
this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
1204             }
1205             
else {
1206                 
this.Adapter.InsertCommand.Parameters[2].Value = ((string)(position));
1207             }
1208             
if ((salary == null)) {
1209                 
this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
1210             }
1211             
else {
1212                 
this.Adapter.InsertCommand.Parameters[3].Value = ((string)(salary));
1213             }
1214             
if ((contact == null)) {
1215                 
this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
1216             }
1217             
else {
1218                 
this.Adapter.InsertCommand.Parameters[4].Value = ((string)(contact));
1219             }
1220             
if ((address == null)) {
1221                 
this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value;
1222             }
1223             
else {
1224                 
this.Adapter.InsertCommand.Parameters[5].Value = ((string)(address));
1225             }
1226             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
1227             
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
1228                         !=
global::System.Data.ConnectionState.Open)) {
1229                 
this.Adapter.InsertCommand.Connection.Open();
1230             }
1231             
try {
1232                 
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
1233                 
return returnValue;
1234             }
1235             
finally {
1236                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1237                     
this.Adapter.InsertCommand.Connection.Close();
1238                 }
1239             }
1240         }
1241         
1242         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1243         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1244         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1245         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1246         
public virtual int Update(string name, string gender, string position, string salary, string contact, string address, int Original_Id, string Original_name, string Original_gender, string Original_position, string Original_salary, string Original_contact, string Original_address, int Id) {
1247             
if ((name == null)) {
1248                 
this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value;
1249             }
1250             
else {
1251                 
this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(name));
1252             }
1253             
if ((gender == null)) {
1254                 
this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
1255             }
1256             
else {
1257                 
this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(gender));
1258             }
1259             
if ((position == null)) {
1260                 
this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
1261             }
1262             
else {
1263                 
this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(position));
1264             }
1265             
if ((salary == null)) {
1266                 
this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
1267             }
1268             
else {
1269                 
this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(salary));
1270             }
1271             
if ((contact == null)) {
1272                 
this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
1273             }
1274             
else {
1275                 
this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(contact));
1276             }
1277             
if ((address == null)) {
1278                 
this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value;
1279             }
1280             
else {
1281                 
this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(address));
1282             }
1283             
this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_Id));
1284             
if ((Original_name == null)) {
1285                 
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(1));
1286                 
this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
1287             }
1288             
else {
1289                 
this.Adapter.UpdateCommand.Parameters[7].Value = ((object)(0));
1290                 
this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_name));
1291             }
1292             
if ((Original_gender == null)) {
1293                 
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1));
1294                 
this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
1295             }
1296             
else {
1297                 
this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0));
1298                 
this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_gender));
1299             }
1300             
if ((Original_position == null)) {
1301                 
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(1));
1302                 
this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value;
1303             }
1304             
else {
1305                 
this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(0));
1306                 
this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(Original_position));
1307             }
1308             
if ((Original_salary == null)) {
1309                 
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1));
1310                 
this.Adapter.UpdateCommand.Parameters[14].Value = global::System.DBNull.Value;
1311             }
1312             
else {
1313                 
this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0));
1314                 
this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Original_salary));
1315             }
1316             
if ((Original_contact == null)) {
1317                 
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1));
1318                 
this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value;
1319             }
1320             
else {
1321                 
this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0));
1322                 
this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(Original_contact));
1323             }
1324             
if ((Original_address == null)) {
1325                 
this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1));
1326                 
this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value;
1327             }
1328             
else {
1329                 
this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0));
1330                 
this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_address));
1331             }
1332             
this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(Id));
1333             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
1334             
if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
1335                         !=
global::System.Data.ConnectionState.Open)) {
1336                 
this.Adapter.UpdateCommand.Connection.Open();
1337             }
1338             
try {
1339                 
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
1340                 
return returnValue;
1341             }
1342             
finally {
1343                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1344                     
this.Adapter.UpdateCommand.Connection.Close();
1345                 }
1346             }
1347         }
1348         
1349         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1350         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1351         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1352         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1353         
public virtual int Update(string name, string gender, string position, string salary, string contact, string address, int Original_Id, string Original_name, string Original_gender, string Original_position, string Original_salary, string Original_contact, string Original_address) {
1354             
return this.Update(name, gender, position, salary, contact, address, Original_Id, Original_name, Original_gender, Original_position, Original_salary, Original_contact, Original_address, Original_Id);
1355         }
1356     }

1357     
1358     ///
<summary>
1359     ///
TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1360     ///</summary>

1361     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
1362     
[global::System.ComponentModel.ToolboxItem(true)]
1363     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1364         
"esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1365     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1366     
public partial class TableAdapterManager : global::System.ComponentModel.Component {
1367         
1368         
private UpdateOrderOption _updateOrder;
1369         
1370         
private staffTableAdapter _staffTableAdapter;
1371         
1372         
private bool _backupDataSetBeforeUpdate;
1373         
1374         
private global::System.Data.IDbConnection _connection;
1375         
1376         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1377         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1378         
public UpdateOrderOption UpdateOrder {
1379             
get {
1380                 
return this._updateOrder;
1381             }
1382             
set {
1383                 
this._updateOrder = value;
1384             }
1385         }
1386         
1387         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1388         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1389         [
global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1390             
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
1391             
"a", "System.Drawing.Design.UITypeEditor")]
1392         
public staffTableAdapter staffTableAdapter {
1393             
get {
1394                 
return this._staffTableAdapter;
1395             }
1396             
set {
1397                 
this._staffTableAdapter = value;
1398             }
1399         }
1400         
1401         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1402         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1403         
public bool BackupDataSetBeforeUpdate {
1404             
get {
1405                 
return this._backupDataSetBeforeUpdate;
1406             }
1407             
set {
1408                 
this._backupDataSetBeforeUpdate = value;
1409             }
1410         }
1411         
1412         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1413         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1414         
[global::System.ComponentModel.Browsable(false)]
1415         
public global::System.Data.IDbConnection Connection {
1416             
get {
1417                 
if ((this._connection != null)) {
1418                     
return this._connection;
1419                 }
1420                 
if (((this._staffTableAdapter != null)
1421                             && (
this._staffTableAdapter.Connection != null))) {
1422                     
return this._staffTableAdapter.Connection;
1423                 }
1424                 
return null;
1425             }
1426             
set {
1427                 
this._connection = value;
1428             }
1429         }
1430         
1431         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1432         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1433         
[global::System.ComponentModel.Browsable(false)]
1434         
public int TableAdapterInstanceCount {
1435             
get {
1436                 
int count = 0;
1437                 
if ((this._staffTableAdapter != null)) {
1438                     count = (count +
1);
1439                 }
1440                 
return count;
1441             }
1442         }

1443         
1444         ///
<summary>
1445         ///
Update rows in top-down order.
1446         ///</summary>

1447         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1448         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1449         
private int UpdateUpdatedRows(hospitalDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1450             
int result = 0;
1451             
if ((this._staffTableAdapter != null)) {
1452                 
global::System.Data.DataRow[] updatedRows = dataSet.staff.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1453                 updatedRows =
this.GetRealUpdatedRows(updatedRows, allAddedRows);
1454                 
if (((updatedRows != null)
1455                             && (
0 < updatedRows.Length))) {
1456                     result = (result +
this._staffTableAdapter.Update(updatedRows));
1457                     allChangedRows.AddRange(updatedRows);
1458                 }
1459             }
1460             
return result;
1461         }

1462         
1463         ///
<summary>
1464         ///
Insert rows in top-down order.
1465         ///</summary>

1466         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1467         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1468         
private int UpdateInsertedRows(hospitalDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1469             
int result = 0;
1470             
if ((this._staffTableAdapter != null)) {
1471                 
global::System.Data.DataRow[] addedRows = dataSet.staff.Select(null, null, global::System.Data.DataViewRowState.Added);
1472                 
if (((addedRows != null)
1473                             && (
0 < addedRows.Length))) {
1474                     result = (result +
this._staffTableAdapter.Update(addedRows));
1475                     allAddedRows.AddRange(addedRows);
1476                 }
1477             }
1478             
return result;
1479         }

1480         
1481         ///
<summary>
1482         ///
Delete rows in bottom-up order.
1483         ///</summary>

1484         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1485         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1486         
private int UpdateDeletedRows(hospitalDataSet dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1487             
int result = 0;
1488             
if ((this._staffTableAdapter != null)) {
1489                 
global::System.Data.DataRow[] deletedRows = dataSet.staff.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1490                 
if (((deletedRows != null)
1491                             && (
0 < deletedRows.Length))) {
1492                     result = (result +
this._staffTableAdapter.Update(deletedRows));
1493                     allChangedRows.AddRange(deletedRows);
1494                 }
1495             }
1496             
return result;
1497         }

1498         
1499         ///
<summary>
1500         ///
Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1501         ///</summary>

1502         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1503         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1504         
private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1505             
if (((updatedRows == null)
1506                         || (updatedRows.Length <
1))) {
1507                 
return updatedRows;
1508             }
1509             
if (((allAddedRows == null)
1510                         || (allAddedRows.Count <
1))) {
1511                 
return updatedRows;
1512             }
1513             
global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1514             
for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1515                 
global::System.Data.DataRow row = updatedRows[i];
1516                 
if ((allAddedRows.Contains(row) == false)) {
1517                     realUpdatedRows.Add(row);
1518                 }
1519             }
1520             
return realUpdatedRows.ToArray();
1521         }

1522         
1523         ///
<summary>
1524         ///
Update all changes to the dataset.
1525         ///</summary>

1526         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1527         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1528         
public virtual int UpdateAll(hospitalDataSet dataSet) {
1529             
if ((dataSet == null)) {
1530                 
throw new global::System.ArgumentNullException("dataSet");
1531             }
1532             
if ((dataSet.HasChanges() == false)) {
1533                 
return 0;
1534             }
1535             
if (((this._staffTableAdapter != null)
1536                         && (
this.MatchTableAdapterConnection(this._staffTableAdapter.Connection) == false))) {
1537                 
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1538                         
"tring.");
1539             }
1540             
global::System.Data.IDbConnection workConnection = this.Connection;
1541             
if ((workConnection == null)) {
1542                 
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1543                         
"ger TableAdapter property to a valid TableAdapter instance.");
1544             }
1545             
bool workConnOpened = false;
1546             
if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1547                         ==
global::System.Data.ConnectionState.Broken)) {
1548                 workConnection.Close();
1549             }
1550             
if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1551                 workConnection.Open();
1552                 workConnOpened =
true;
1553             }
1554             
global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1555             
if ((workTransaction == null)) {
1556                 
throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1557                         
"ctions or the current state is not allowing the transaction to begin.");
1558             }
1559             
global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1560             
global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1561             
global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1562             
global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1563             
int result = 0;
1564             
global::System.Data.DataSet backupDataSet = null;
1565             
if (this.BackupDataSetBeforeUpdate) {
1566                 backupDataSet =
new global::System.Data.DataSet();
1567                 backupDataSet.Merge(dataSet);
1568             }
1569             
try {
1570                 
// ---- Prepare for update -----------
1571                 
//
1572                 
if ((this._staffTableAdapter != null)) {
1573                     revertConnections.Add(
this._staffTableAdapter, this._staffTableAdapter.Connection);
1574                     
this._staffTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1575                     
this._staffTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1576                     
if (this._staffTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1577                         
this._staffTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1578                         adaptersWithAcceptChangesDuringUpdate.Add(
this._staffTableAdapter.Adapter);
1579                     }
1580                 }
1581                 
//
1582                 
//---- Perform updates -----------
1583                 
//
1584                 
if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1585                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1586                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1587                 }
1588                 
else {
1589                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1590                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1591                 }
1592                 result = (result +
this.UpdateDeletedRows(dataSet, allChangedRows));
1593                 
//
1594                 
//---- Commit updates -----------
1595                 
//
1596                 workTransaction.Commit();
1597                 
if ((0 < allAddedRows.Count)) {
1598                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1599                     allAddedRows.CopyTo(rows);
1600                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1601                         
global::System.Data.DataRow row = rows[i];
1602                         row.AcceptChanges();
1603                     }
1604                 }
1605                 
if ((0 < allChangedRows.Count)) {
1606                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1607                     allChangedRows.CopyTo(rows);
1608                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1609                         
global::System.Data.DataRow row = rows[i];
1610                         row.AcceptChanges();
1611                     }
1612                 }
1613             }
1614             
catch (global::System.Exception ex) {
1615                 workTransaction.Rollback();
1616                 
// ---- Restore the dataset -----------
1617                 
if (this.BackupDataSetBeforeUpdate) {
1618                     
global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1619                     dataSet.Clear();
1620                     dataSet.Merge(backupDataSet);
1621                 }
1622                 
else {
1623                     
if ((0 < allAddedRows.Count)) {
1624                         
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1625                         allAddedRows.CopyTo(rows);
1626                         
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1627                             
global::System.Data.DataRow row = rows[i];
1628                             row.AcceptChanges();
1629                             row.SetAdded();
1630                         }
1631                     }
1632                 }
1633                 
throw ex;
1634             }
1635             
finally {
1636                 
if (workConnOpened) {
1637                     workConnection.Close();
1638                 }
1639                 
if ((this._staffTableAdapter != null)) {
1640                     
this._staffTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._staffTableAdapter]));
1641                     
this._staffTableAdapter.Transaction = null;
1642                 }
1643                 
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1644                     
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1645                     adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1646                     
for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1647                         
global::System.Data.Common.DataAdapter adapter = adapters[i];
1648                         adapter.AcceptChangesDuringUpdate =
true;
1649                     }
1650                 }
1651             }
1652             
return result;
1653         }
1654         
1655         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1656         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1657         
protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1658             
global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1659         }
1660         
1661         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1662         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1663         
protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1664             
if ((this._connection != null)) {
1665                 
return true;
1666             }
1667             
if (((this.Connection == null)
1668                         || (inputConnection ==
null))) {
1669                 
return true;
1670             }
1671             
if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1672                 
return true;
1673             }
1674             
return false;
1675         }

1676         
1677         ///
<summary>
1678         ///
Update Order Option
1679         ///</summary>

1680         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1681         
public enum UpdateOrderOption {
1682             
1683             InsertUpdateDelete =
0,
1684             
1685             UpdateInsertDelete =
1,
1686         }

1687         
1688         ///
<summary>
1689         ///
Used to sort self-referenced table's rows
1690         ///</summary>

1691         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1692         
private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1693             
1694             
private global::System.Data.DataRelation _relation;
1695             
1696             
private int _childFirst;
1697             
1698             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1699             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1700             
internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1701                 
this._relation = relation;
1702                 
if (childFirst) {
1703                     
this._childFirst = -1;
1704                 }
1705                 
else {
1706                     
this._childFirst = 1;
1707                 }
1708             }
1709             
1710             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1711             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1712             
private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
1713                 
global::System.Diagnostics.Debug.Assert((row != null));
1714                 
global::System.Data.DataRow root = row;
1715                 distance =
0;
1716
1717                 
global::System.Collections.Generic.IDictionary<global::System.Data.DataRow, global::System.Data.DataRow> traversedRows = new global::System.Collections.Generic.Dictionary<global::System.Data.DataRow, global::System.Data.DataRow>();
1718                 traversedRows[row] = row;
1719
1720                 
global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1721                 
for (
1722                 ; ((parent !=
null)
1723                             && (traversedRows.ContainsKey(parent) ==
false));
1724                 ) {
1725                     distance = (distance +
1);
1726                     root = parent;
1727                     traversedRows[parent] = parent;
1728                     parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Default);
1729                 }
1730
1731                 
if ((distance == 0)) {
1732                     traversedRows.Clear();
1733                     traversedRows[row] = row;
1734                     parent = row.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1735                     
for (
1736                     ; ((parent !=
null)
1737                                 && (traversedRows.ContainsKey(parent) ==
false));
1738                     ) {
1739                         distance = (distance +
1);
1740                         root = parent;
1741                         traversedRows[parent] = parent;
1742                         parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1743                     }
1744                 }
1745
1746                 
return root;
1747             }
1748             
1749             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1750             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1751             
public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1752                 
if (object.ReferenceEquals(row1, row2)) {
1753                     
return 0;
1754                 }
1755                 
if ((row1 == null)) {
1756                     
return -1;
1757                 }
1758                 
if ((row2 == null)) {
1759                     
return 1;
1760                 }
1761
1762                 
int distance1 = 0;
1763                 
global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
1764
1765                 
int distance2 = 0;
1766                 
global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
1767
1768                 
if (object.ReferenceEquals(root1, root2)) {
1769                     
return (this._childFirst * distance1.CompareTo(distance2));
1770                 }
1771                 
else {
1772                     
global::System.Diagnostics.Debug.Assert(((root1.Table != null)
1773                                     && (root2.Table !=
null)));
1774                     
if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
1775                         
return -1;
1776                     }
1777                     
else {
1778                         
return 1;
1779                     }
1780                 }
1781             }
1782         }
1783     }
1784 }
1785
1786 #pragma warning restore
1591


Gõ tìm kiếm nhanh...